
package org.bsc.mgwt.client;

import org.bsc.mgwt.client.activity.MVPExplorerActivity;
import org.bsc.mgwt.client.activity.MVPTabActivity;
import org.bsc.mgwt.client.place.MVPExplorerPlace;
import org.bsc.mgwt.client.place.MVPTabPlace;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;


/**
 * 
 */
public class PhoneActivityMapper implements ActivityMapper {

	private final ClientFactory clientFactory;

	public PhoneActivityMapper(ClientFactory clientFactory) {
		this.clientFactory = clientFactory;
	}

	@Override
	public Activity getActivity(Place place) {
		
		if( place instanceof MVPTabPlace ) {
			
			return new MVPTabActivity(clientFactory);
		}
		if( place instanceof MVPExplorerPlace ) {
			
			return new MVPExplorerActivity(clientFactory);
		}

		return null;
	}
}
